home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
- #
- # TV-Man.h
- #
- # Copyright © Apple Computer, Inc. 1989-1990
- # All rights reserved.
- #
- #
- #
- #
- # This is the file that is common to all sources and resources. It contains all the
- # constants which can be acted upon locally.
- #
- # In order to have an evironment which predictable events happen several definitions
- # must be established. The most critical is in the file architecture. Each functional
- # block will have its own source and header file. The main project file, in this
- # case TV-Man, will have its header file included with all other files. This will
- # allow for global constants. The utility source file shall contain functions that
- # are general purpose in nature and that can be used by all other functions. These
- # are intended not to be application or major block specific. In order for this to be
- # accomodated all functions in the utility source file must use only the information
- # that is passed to them or information that can be gleaned from the system via
- # toolbox calls. There will be no header file associated with the utility file as this
- # will destroy the intent of the utilities.
- #
- # There are several files which contain information which is global in nature .These
- # file are included in the main project header file. They are: x.Errors.h, x.Ext.h,
- # x.Protos.h, x.Menus.h. The reason for containing them in seperate files is one of
- # convienience and accesability.
- #
- #
- # Revision Log:
- #
- # 4-26-91 RGK Creation
- #
- #
- ------------------------------------------------------------------------------*/
-
- /*----------------------------------------------------------------------------*/
- /* We made the preferred size bigger than the minimum size by 12K, so that
- there would be even more room for the scrap, FKEYs, etc. */
-
- #define kMinSize 50 /* application's minimum size (in K) */
- #define kPrefSize 75 /* application's preferred size (in K) */
-
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
- SysEnvRec we understand. */
-
- #define kSysEnvironsVersion 1
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kTopLeft - This is for positioning the Disk Initialization dialogs. */
-
- #define kDITop 0x0050
- #define kDILeft 0x0070
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kMinHeap - This is the minimum result from the following
- equation:
-
- ORD(GetApplLimit) - ORD(ApplicZone)
-
- for the application to run. It will insure that enough memory will
- be around for reasonable-sized scraps, FKEYs, etc. to exist with the
- application, and still give the application some 'breathing room'.
- To derive this number, we ran under a MultiFinder partition that was
- our requested minmum size, as given in the 'SIZE' resource. */
-
- #define kMinHeap 45 * 1024
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kMinSpace - This is the minimum result from PurgeSpace, when called
- at initialization time, for the application to run. This number acts
- as a double-check to insure that there really is enough memory for the
- application to run, including what has been taken up already by
- pre-loaded resources, the scrap, code, and other sundry memory blocks. */
-
- #define kMinSpace 15 * 1024
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
-
- #define kExtremeNeg -32768
- #define kExtremePos 32767 - 1 /* required to address an old region bug */
-
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
- by MultiFinder. Once we determine that an event is an osEvent, we look at the
- high byte of the message sent to determine which kind it is. To differentiate
- suspend and resume events we check the resumeMask bit. */
-
- #define kOSEvent app4Evt /* event used by MultiFinder */
- #define kSuspendResumeMessage 1 /* high byte of suspend/resume event message */
- #define kResumeMask 1 /* bit of message field for resume vs. suspend */
- #define kMouseMovedMessage 0xFA /* high byte of mouse-moved event message */
- #define kNoEvents 0 /* no events mask */
-
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* Define HiWrd and LoWrd macros for efficiency. */
-
- #define HiWrd(aLong) (((aLong) >> 16) & 0xFFFF)
- #define LoWrd(aLong) ((aLong) & 0xFFFF)
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* Define TopLeft and BotRight macros for convenience. Notice the implicit
- dependency on the ordering of fields within a Rect */
-
- #define TopLeft(aRect) (* (Point *) &(aRect).top)
- #define BotRight(aRect) (* (Point *) &(aRect).bottom)
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* Misc Resource ID base numbers. The functional blocks will have resource
- Id numbers based opon these values. This is a effort to group resources of
- like types by function. */
-
- #define rDfltId 200
- #define rMainApp (rDfltId) /* Main application resource root */
- #define rErrors (rDfltId + 1) /* Error data resource root */
- #define rVideo (rDfltId + 2) /* video resource root */
- #define rSounds (rDfltId + 3) /* Sound Dialog resource root */
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* The above resource numbers will be used in calculations in the various
- header files to give logical groupings to resource numbers. The following
- resources are here because it is part of the main application block and
- will serve as a simple example. */
-
- #define rMenu (rMainApp * 10) /* applications menu bar */
- #define rWindow (rMainApp * 10) + 1 /* application's window */
- #define rIcon (rMainApp * 10) + 2 /* this applications Icon */
- #define rFref (rMainApp * 10) + 3 /* Fref resource */
- #define rAboutAlert (rMainApp * 10) + 4 /* about alert box */
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* Misc.Keyboard constants. */
-
- #define ENTERKEY 3
- #define RETURNKEY 13
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* if this program is to be run on a machine with system seven set the following
- definition to be true */
-
- #define SystemSevenOrLater true
-
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /*----------------------------------------------------------------------------*/
- /* The following line will effectivly eliminate the following typedefs from the
- this header file during the Rez process because Rez cannot handle typedefs.
- All Resource files will define "__Rezing__" when processing, all C sources
- will not */
-
- #ifndef __Rezing__
-
-
-
-
- /*----------------------------------------------------------------------------*/
- /* This is a list of all the necessary ToolBox include files. */
-
- #include <Memory.h>
- #include <OSEvents.h>
- #include <DiskInit.h>
- #include <ToolUtils.h>
- #include <Values.h>
- #include <Desk.h>
- #include <Resources.h>
- #include <Dialogs.h>
- #include <Traps.h>
- #include <Menus.h>
- #include <Palette.h>
- #include <Packages.h>
- #include <Fonts.h>
- #include <Sound.h>
-
-
-
-
- /* These are the other avaliable ToolBox includes here for convienance, cut and
- paste to above list to use */
-
- /*
- #include <OSUtils.h>
- #include <Files.h>
- #include <SegLoad.h>
- #include <TextEdit.h>
- #include <QuickDraw.h>
- #include <Types.h>
- #include <Windows.h>
- #include <Events.h>
- */
-
-
-
-
-
- #ifndef __Beep__ /* test to see if the Beep structure has already been defined */
- #define __Beep__
-
- /*----------------------------------------------------------------------------*/
- /* This is the resource structure for the beep data. Since it is used in TV-Man
- as a global it is defined in the TV-Man.h file. This allows everyone to see
- it. The ifdef switch is used to limit the number of the Beep structures that
- the compilier will try to use. This structure resides here because it is part
- of the sound system and if removed from TV-Man it will have to leave with it. */
-
- typedef struct Beep
- {
- short Enabled;
- short Type;
- short Length;
- short QTime;
- short Count;
- short Delay;
- short Volume;
- short Freq;
- short Init; /* the sound channel init id */
- short RsrcId; /* the resource id */
- Str32 Title;
- } Beep, *BeepPtr, **BeepHdl;
-
-
-
- /*----------------------------------------------------------------------------*/
- /* This Structure is used to hold the global varables which make a "Beep
- Channel". */
-
- typedef struct BeepChan
- {
- Boolean Error; /* true if any sound setup errored */
- Boolean InProcess; /* true if any sound setup errored */
- short RsrcId; /* the resource id */
- SndChannelPtr SndChannel; /* Pointer to the 1st sound channel */
- } BeepChan, *BeepCPtr, **BeepCHdl;
-
-
-
-
- #endif __Beep__
-
-
-
-
- /* These are all the "local" includes necessary in a global concept */
-
- #include "TV-Man.Ext.h"
- #include "TV-Man.Menus.h"
- #include "TV-Man.Errors.h"
- #include "TV-Man.Protos.h"
-
-
-
- /* The next command identifies the rest of the IF statement as only used during Rezing */
- #else
-
- /* the following should have been in "SysTypes.r" but aren't */
-
- #define initChan0 0x0004 /* channel 0 - wave table only */
- #define initChan1 0x0005 /* channel 1 - wave table only */
- #define initChan2 0x0006 /* channel 2 - wave table only */
- #define initChan3 0x0007 /* channel 3 - wave table only */
-
-
-
-
- #endif __Rezing__
-
-